<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Main Window</title>
    <link rel="stylesheet" href="assets/main.css">
</head>
<body>
    <img class="logo center" src="assets/photino-logo-full.png">
    <button class="primary random center">Open Random Window</button>
    <button class="close center">Close Window</button>

    <script>
        (() => {
            document.querySelector('.random')
                .addEventListener('click', event => {
                    window.external.sendMessage('random-window');
                });

            document.querySelector('.close')
                .addEventListener('click', event => {
                    window.external.sendMessage('close-window');
                });

            window.external.receiveMessage(message => alert(message));
        })();
    </script>
</body>
</html>